package com.cesgroup.zw.spring.boot.library.echarts.pie.complex;

import com.cesgroup.zw.spring.boot.echarts.build.EChartsOption;
import com.cesgroup.zw.spring.boot.echarts.component.Grid;
import com.cesgroup.zw.spring.boot.echarts.component.Legend;
import com.cesgroup.zw.spring.boot.echarts.component.Title;
import com.cesgroup.zw.spring.boot.echarts.enums.Align;
import com.cesgroup.zw.spring.boot.echarts.enums.Orient;
import com.cesgroup.zw.spring.boot.echarts.model.style.RichTextStyle;

/**
 * <p>带透明圈的饼图</p>
 * @author ytj
 * @date 2019/7/4 15:11
 */
@SuppressWarnings("serial")
public class ComplexPieOption extends EChartsOption{
    public  ComplexPieOption(ComplexPieParam param){
        if(param.getColor()!=null&&param.getColor().length>0);
            this.setColor(param.getColor());
        this.setBackgroundColor("#000");
        this.setTitle(new Title(){{
            this.setText("总数");
            this.setSubtext("7789");
            this.setTextStyle(new RichTextStyle(){{
                this.setColor("#f2f2f2");
                this.setFontSize(40);
            }});
            this.setSubtextStyle(new RichTextStyle(){{
                this.setFontSize(30);
                this.setColor("#ff9d19");
            }});
            this.setLeft(Align.center);
            this.setTop(Align.center);
        }});
        this.setGrid(new Grid(){{
            this.setBottom(150);
            this.setLeft(100);
            this.setRight("10%");
        }});
        this.setLegend(new Legend(){{
            this.setOrient(Orient.vertical);
            this.setTop(Align.middle);
            this.setRight("5%");
            this.setTextStyle(new RichTextStyle(){{
                this.setColor("#f2f2f2");
                this.setFontSize(25);
            }});

        }});

    }
}
